//
//  FWTextField.m
//  BirdLoveSheep
//
//  Created by wwj on 16/3/15.
//  Copyright © 2016年 wwj. All rights reserved.
//

#import "FWTextField.h"
#import <objc/runtime.h>

@implementation FWTextField

//+ (void)initialize{
//    unsigned int count;
//    Ivar *ivars = class_copyIvarList([UITextField class], &count);
//    
//    for (int index = 0; index < count; index ++) {
//        Ivar var = ivars[index];
//        MyLog(@"%s", ivar_getName(var));
//    }
//}

- (void)awakeFromNib{
    [super awakeFromNib];
    self.tintColor = self.textColor;
    [self resignFirstResponder];
}

- (BOOL)becomeFirstResponder{
    [self setValue:self.textColor forKeyPath:@"_placeholderLabel.textColor"];
    return [super becomeFirstResponder];
}

- (BOOL)resignFirstResponder{
    [self setValue:[UIColor grayColor] forKeyPath:@"_placeholderLabel.textColor"];
    return [super resignFirstResponder];
    
}

@end
